package com.sgolub.commanndsonline.service.entity;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sgolub.commanndsonline.dao.entity.OperationItemDAO;
import com.sgolub.commanndsonline.domain.entity.OperationItem;

@Service
public class OperationItemServiceImpl implements OperationItemService{

	@Autowired
	private OperationItemDAO dao;
	
	@Transactional
	public OperationItem get(Integer id) {
		return dao.get(id);
	}

	@Transactional
	public void add(OperationItem item) {
		dao.add(item);
	}

	@Transactional
	public void update(OperationItem item) {
		dao.update(item);
	}

	@Transactional
	public void remove(Integer id) {
		dao.remove(id);
	}

	@Transactional
	public List<OperationItem> list() {
		return dao.list();
	}

	@Transactional
    public List<OperationItem> listByInventarNr(String inventarNr){
    	return dao.listByInventarNr(inventarNr);
    }
    
    @Transactional
    public List<OperationItem> listByAdvertisingRegistryId(Integer advertisingRegistryId){
    	return dao.listByAdvertisingRegistryId(advertisingRegistryId);
    }
	
	@Transactional
	public List<OperationItem> filter() {
		return dao.list();
	}
	
}
